package com.ganbo.stock.repository;

import com.ganbo.stock.entity.Stock;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


@Repository
public interface StockRepository extends JpaRepository<Stock, Long> {


    Stock findByDm(String dm);

    @Query("SELECT o FROM Stock o ORDER BY o.updateCompanyVersion ASC ")
    Page<Stock> findMinVersion(Pageable pageable);
}
